const passport = require('koa-passport')

module.exports = function(routers, app) {
   //google
   routers.get('/auth/google', passport.authenticate('google'))
   routers.get('/auth/google/callback',

    passport.authenticate('google', {
        successRedirect: '/success.html',
        failureRedirect: '/failure.html'
    }))
   

   //facebook
   routers.get('/auth/facebook', passport.authenticate('facebook'))
   routers.get('/auth/facebook/callback',

    passport.authenticate('facebook', {
        successRedirect: '/success.html',
        failureRedirect: '/failure.html'
    }))

    //twitter
   routers.get('/auth/twitter', passport.authenticate('twitter'))
   routers.get('/auth/twitter/callback',

    passport.authenticate('twitter', {
        successRedirect: '/success.html',
        failureRedirect: '/failure.html'
    }))

    //weixin
   routers.get('/auth/weixin', passport.authenticate('weixin'))
   routers.get('/auth/weixin/callback',

    passport.authenticate('weixin', {
        successRedirect: '/success.html',
        failureRedirect: '/failure.html'
    }))

     //weibo
   routers.get('/auth/weibo', passport.authenticate('weibo'))
   routers.get('/auth/weibo/callback',

    passport.authenticate('weibo', {
        successRedirect: '/success.html',
        failureRedirect: '/failure.html'
    }))

     //qq
   routers.get('/auth/qq', passport.authenticate('qq'))
   routers.get('/auth/qq/callback',

    passport.authenticate('qq', {
        successRedirect: '/success.html',
        failureRedirect: '/failure.html'
    }))
}